#include <stdio.h>
#include <iostream>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>

using namespace std;

int main() {
    int deviceCount;
    cudaError_t error = cudaGetDeviceCount(&deviceCount);
    if (error != cudaSuccess) {
        cout << "cuda getDeviceCount error, errorCode=" << error << endl;
        exit(1);
    }

    for (int dev = 0; dev < deviceCount; ++dev) {
        cudaDeviceProp deviceProp;
        cudaGetDeviceProperties(&deviceProp, dev);
        cout << "deviceNo=" << dev << endl; // 第几张显卡
        cout << "DeviceName=" << deviceProp.name  << endl;
        cout << "multiProcessorCount=" << deviceProp.multiProcessorCount << endl;
        cout << "maxBlocksPerMultiProcessor=" << deviceProp.maxBlocksPerMultiProcessor << endl;
        cout << "maxThreadsPerMultiProcessor=" << deviceProp.maxThreadsPerMultiProcessor << endl;
        // 注意：CUDA核心数通常指的是SMs（Streaming Multiprocessors）的数量，而不是CUDA核心的数量。
        // CUDA核心通常指的是每个SM上的CUDA Core数量，可以通过deviceProp.maxThreadsPerMultiProcessor获取。
    

    }


}